import React from 'react';
import { Input } from 'antd';

function Feg() {
  const onChange = (e) => {
    console.log(e.target.value);
    const value = e.target.value;

    const numbericValue = value.replace(/[^0-9.]/g, '');
    if (!numbericValue) return;
    const numberValue = parseFloat(numbericValue);

    const formatter = new Intl.NumberFormat('en-US', {
      // style: 'currency',
      // currency: 'USD',
      minimumFractionDigits: 2,
    });

    const formattedValue = formatter.format(numberValue);
    console.log(formattedValue);
  };
  return (
    <div>
      <Input onInput={onChange} />
    </div>
  );
}

export default Feg;
